﻿namespace Orc.Sort.Tests;

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using NUnit.Framework;
using PublicApiGenerator;
using VerifyNUnit;

[TestFixture]
public class PublicApiFacts
{
    [Test, MethodImpl(MethodImplOptions.NoInlining)]
    public async Task Orc_Sort_HasNoBreakingChanges_Async()
    {
        var assembly = typeof(IEnumerableExtensions).Assembly;

        await PublicApiApprover.ApprovePublicApiAsync(assembly);
    }
}

internal static class PublicApiApprover
{
    public static async Task ApprovePublicApiAsync(Assembly assembly)
    {
        var publicApi = ApiGenerator.GeneratePublicApi(assembly, new ApiGeneratorOptions());
        await Verifier.Verify(publicApi);
    }
}
